namespace DesignPattern.Structural.Adapter
{
    public class MediaAdapter : IMediaPlayer
    {
        public void Play(MediaType mediaType, string filename)
        {
            IAdvancedMeadiaPlayer player;

            switch (mediaType)
            {
                case MediaType.MP4:
                    player = new Mp4Player();
                    player.PlayMp4(filename);
                    break;
                case MediaType.MKV:
                    player = new MkvPlayer();
                    player.PlayMkv(filename);
                    break;
                case MediaType.AVI:
                    player = new AviPlayer();
                    player.PlayAvi(filename);
                    break;
                default:
                    throw new System.ArgumentException(nameof(mediaType));
            }
        }
    }
}